<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateOrdersTable extends Migration {
	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up() {
		Schema::create('orders', function (Blueprint $table) {
			$table->increments('id');
			$table->integer('map_id')->comment('渠道与活动关联id');
			$table->string('order_id', 120)->comment('订单id');
			$table->string('contacts', 50)->comment('联系人');
			$table->string('phone', 11)->comment('联系电话');
			$table->text('products')->comment('商品信息');
			$table->string('receipt_name', 50)->comment('收货人');
			$table->string('receipt_address', 120)->comment('收货地址');
			$table->dateTime('order_time')->comment('订单创建时间');
			$table->dateTime('send_time')->nullable()->comment('短信发送时间');
			$table->decimal('price', 10, 2)->comment('订单金额');
			$table->boolean('type')->default(false)->comment('订单状态');
			$table->timestamps();
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down() {
		Schema::dropIfExists('orders');
	}
}
